package org.feign.client;

import org.feign.client.fallback.UserFeignClientFallback;
import org.feign.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.Map;

// @FeignClient 代表 当前是一个feign客户端
// value = user-service  代表这个客户端要调用的微服务名称 user-service
@FeignClient(value = "user-service",fallback = UserFeignClientFallback.class)
public interface UserFeignClient {
    @GetMapping("/user/{id}")
    public User findById(@PathVariable("id") String id);
}
